package com.mt.demo.service.impl;

import com.mt.demo.util.DateUtils;
import com.mt.demo.domain.MtMeeting;
import com.mt.demo.mapper.MtMeetingMapper;
import com.mt.demo.service.IMtMeetingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会议主Service业务层处理
 * 
 * @author gary
 * @date 2025-08-11
 */
@Service
public class MtMeetingServiceImpl implements IMtMeetingService 
{
    @Autowired
    private MtMeetingMapper mtMeetingMapper;

    /**
     * 查询会议主
     * 
     * @param meetingId 会议主主键
     * @return 会议主
     */
    @Override
    public MtMeeting selectMtMeetingByMeetingId(Long meetingId)
    {
        return mtMeetingMapper.selectMtMeetingByMeetingId(meetingId);
    }

    /**
     * 查询会议主列表
     * 
     * @param mtMeeting 会议主
     * @return 会议主
     */
    @Override
    public List<MtMeeting> selectMtMeetingList(MtMeeting mtMeeting)
    {
        return mtMeetingMapper.selectMtMeetingList(mtMeeting);
    }

    /**
     * 新增会议主
     * 
     * @param mtMeeting 会议主
     * @return 结果
     */
    @Override
    public int insertMtMeeting(MtMeeting mtMeeting)
    {
        mtMeeting.setCreateTime(DateUtils.getNowDate());
        return mtMeetingMapper.insertMtMeeting(mtMeeting);
    }

    /**
     * 修改会议主
     * 
     * @param mtMeeting 会议主
     * @return 结果
     */
    @Override
    public int updateMtMeeting(MtMeeting mtMeeting)
    {
        mtMeeting.setUpdateTime(DateUtils.getNowDate());
        return mtMeetingMapper.updateMtMeeting(mtMeeting);
    }

    /**
     * 批量删除会议主
     * 
     * @param meetingIds 需要删除的会议主主键
     * @return 结果
     */
    @Override
    public int deleteMtMeetingByMeetingIds(Long[] meetingIds)
    {
        return mtMeetingMapper.deleteMtMeetingByMeetingIds(meetingIds);
    }

    /**
     * 删除会议主信息
     * 
     * @param meetingId 会议主主键
     * @return 结果
     */
    @Override
    public int deleteMtMeetingByMeetingId(Long meetingId)
    {
        return mtMeetingMapper.deleteMtMeetingByMeetingId(meetingId);
    }
}
